package main.service;

import java.util.List;

import main.entity.ChannelVO;

import org.springframework.stereotype.Service;

@Service("channelService")
public class ChannelService extends BaseService<ChannelVO> {

	public List<ChannelVO> getAllChannels(){
		List<ChannelVO> list = getBaseDAO().loadAll(ChannelVO.class);
		return list;
	}
	
/*	public List<ChannelVO> getByModuleID(Integer moduleID){
		ChannelVO channelVO = new ChannelVO();
		channelVO.setModuleID(moduleID);
		List<ChannelVO> list = (List<ChannelVO>) getBaseDAO().findByExample(channelVO);
		return list;
	}*/
	
	@SuppressWarnings("unchecked")
	public List<ChannelVO> getByModuleID(Integer moduleID){
		String queryString = "from main.entity.ChannelVO where moduleID=?";
//		System.out.println(getBaseDAO().findByHQL(queryString, moduleID));
		return getBaseDAO().findByHQL(queryString, moduleID);
	}
	
}

